package com.course.controller;


import com.course.entity.DayVideoAccessStat;
import com.course.repository.DayVideoAccessStatRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/report")
public class DayVideoAccessStatHandler {

    @Autowired
    private DayVideoAccessStatRepository dayVideoAccessStatRepository;

    @GetMapping("/findAll")
    public List<DayVideoAccessStat> findAll() {
        return dayVideoAccessStatRepository.findAllByOrderByTimes();
    }
}
